<?php

namespace app\common\model\tyyh;

class Collect extends CUBase {
	protected $append = ['product'];

	public function getProductAttr($value, $data) {
		$model = loadOnly('Model')->getModel('tysj\\Product');
		$productStatusEnum = loadEnum('ProductStatus');
		$productExamineEnum = loadEnum('ProductExamine');
		$row = $model->where(['status' => $productStatusEnum->code2key('shangjia'), 'examine' => $productExamineEnum->code2key('shenhewancheng')])->find($data['pid']);
		if($row) {
			$row->privacy()->append(['specs_list']);
		}
		return $row;
	}
}